package com.meizu.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.meizu.entity.User;

@Repository
public interface UserRepository extends JpaRepository<User, String>{
	@Query("from User u where u.name =:name")
    List<User> findByName(@Param(value = "name") String name);
	
	@Query("from User u,Role r where u.roleId = r.id and u.name =:name")
	List<User> findByOrgName(@Param(value = "name") String name);
}
